<style lang="less" scoped>
.report-details {
  width: 100%;
  height: 100%;
  background-color: #fff;
  padding: 5px;
  box-sizing: border-box;
  overflow: auto;
  .el-divider--horizontal {
    margin: 10px 0;
  }
  .box-title {
    text-align: center;
    font-size: 20px;
    line-height: 30px;
    font-weight: bold;
  }
  .box-img {
    display: flex;
    // justify-content: space-between;
    width: 100%;
    height: 300px;
    div {
      width: 450px;
      height: 100%;
    }
  }
  .box-video {
    width: 100%;
    // margin-top: 10px;
    // padding: 0 10px;
    box-sizing: border-box;
  }
  .box-table {
    margin-top: 5px;
  }
  .box-submit {
    width: 100%;
    text-align: center;
  }
}
</style>

<template>
  <div>
    <div class="report-details" v-loading="loading">
      <div class="report-type">项目类型：{{ auditObject.project }}</div>
      <!-- <div class="box-title">{{ $store.getters.insname }}</div> -->
      <div class="box-title">超声筛查报告单</div>
      <el-divider />
      <el-form :model="formInline" inline class="demo-form-inline">
        <el-row>
          <el-col :span="8">
            <el-form-item label="">
              <template #label>
                <span style="color: #000; font-size: 16px">姓名：</span>
              </template>
              <span style="font-size: 16px">{{ auditObject.name }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="">
              <template #label>
                <span style="color: #000; font-size: 16px">性别：</span>
              </template>
              <span style="font-size: 16px">{{ auditObject.sex }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="">
              <template #label>
                <span style="color: #000; font-size: 16px">年龄：</span>
              </template>
              <span style="font-size: 16px">{{ auditObject.age }}岁</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="">
              <template #label>
                <span style="color: #000; font-size: 16px">申请机构：</span>
              </template>
              <span style="font-size: 16px">{{ auditObject.insname }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="">
              <template #label>
                <span style="color: #000; font-size: 16px">患者ID：</span>
              </template>
              <span style="font-size: 16px">{{ auditObject.t_sn }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="">
              <template #label>
                <span style="color: #000; font-size: 16px">检查部位：</span>
              </template>
              <span style="font-size: 16px">{{ auditType }}</span>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
        影像截图
      </div>
      <div
        style="width: 100%; height: 1px; background-color: #666; margin: 5px 0"
      ></div>
      <div class="box-img">
        <div>
          <el-image
            style="width: 100%; height: 100%"
            :src="auditObject.screenshot1Url"
            fit="contain"
            :preview-src-list="[auditObject.screenshot1Url]"
          >
            <template #error>
              <div class="image-slot">
                <el-icon><icon-picture /></el-icon>
              </div>
            </template>
          </el-image>
        </div>
        <div>
          <el-image
            style="width: 100%; height: 100%"
            :src="auditObject.screenshot2Url"
            fit="contain"
            :preview-src-list="[auditObject.screenshot2Url]"
          >
            <template #error>
              <div class="image-slot">
                <el-icon><icon-picture /></el-icon>
              </div>
            </template>
          </el-image>
        </div>
      </div>
      <!-- <div style="width: 100%; height: 1px; background-color: #666; margin: 5px 0;"></div> -->
      <div class="box-video">
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          原始影像
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <el-button
          v-if="auditObject.dicomurl"
          v-for="(item, index) in auditObject.dicomurl.split(',')"
          :key="index"
          type="primary"
          style="margin: 10px 10px"
        >
          <a
            :href="item"
            target="_blanl"
            :style="{
              textDecoration: 'none',
              pointerEvents: !item ? 'none' : '',
              color: '#fff',
            }"
            >查看影像{{ index + 1 }}</a
          >
        </el-button>
        <!-- <div v-for="(item, index) in videoList" :key="index" style="display: inline-block;">
          <video v-if="item" controls style="width: 450px;height: 300px;">
            <source :src="item" type="video/mp4">
          </video>
        </div> -->
      </div>
      <div class="box-table">
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          检测数值
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <table
          v-if="
            auditType == '颈动脉' &&
            auditObject.project &&
            auditObject.project.includes('心血管')
          "
          border="1"
          style="width: 70%; border-collapse: collapse"
        >
          <tr>
            <td colspan="6">左侧</td>
          </tr>
          <tr>
            <td colspan="6">CCA-IMT(mm)</td>
          </tr>
          <tr>
            <td style="width: 100px">近段</td>
            <td style="width: 100px">{{ auditJson.ccaImtProximalL }}</td>
            <td style="width: 100px">中段</td>
            <td style="width: 100px">{{ auditJson.ccaImtMiddleL }}</td>
            <td style="width: 100px">远段</td>
            <td style="width: 100px">{{ auditJson.ccaImtDistalL }}</td>
          </tr>
          <tr>
            <td colspan="6">斑块（单位mm，空缺为正常）</td>
          </tr>
          <tr>
            <td>数量（1=单发，2=多发）</td>
            <td>
              {{ auditJson.plaqueCountL }}
            </td>
            <td>最大者长度</td>
            <td>
              {{ auditJson.plaqueLengthMaxL }}
            </td>
            <td>最大者厚度</td>
            <td>
              {{ auditJson.plaqueThicknessMaxL }}
            </td>
          </tr>
          <tr>
            <td colspan="2">形态（1=规则型，2=不规则型）</td>
            <td>
              {{ auditJson.plaqueShapeL }}
            </td>
            <td colspan="2">是否溃疡型（0=否，1=是）</td>
            <td>
              {{ auditJson.plaqueUlcerL }}
            </td>
          </tr>
          <tr>
            <td colspan="5">
              质地（A1=均质低回声，A2=均质等回声，A3=均质强回声，B=不均质）
            </td>
            <td>
              {{ auditJson.plaqueTextureL }}
            </td>
          </tr>
          <tr>
            <td colspan="2">管腔直径狭窄率%</td>
            <td>
              {{ auditJson.plaqueStenosisRateL }}
            </td>
            <td colspan="2">狭窄部位</td>
            <td>
              {{ auditJson.plaqueStenosisPositionL }}
            </td>
          </tr>
          <tr>
            <td colspan="6">右侧</td>
          </tr>
          <tr>
            <td colspan="6">CCA-IMT(mm)</td>
          </tr>
          <tr>
            <td>近段</td>
            <td>
              {{ auditJson.ccaImtProximalR }}
            </td>
            <td>中段</td>
            <td>
              {{ auditJson.ccaImtMiddleR }}
            </td>
            <td>远段</td>
            <td>
              {{ auditJson.ccaImtDistalR }}
            </td>
          </tr>
          <tr>
            <td colspan="6">斑块（单位mm，空缺为正常）</td>
          </tr>
          <tr>
            <td>数量（1=单发，2=多发）</td>
            <td>
              {{ auditJson.plaqueCountR }}
            </td>
            <td>最大者长度</td>
            <td>
              {{ auditJson.plaqueLengthMaxR }}
            </td>
            <td>最大者厚度</td>
            <td>
              {{ auditJson.plaqueThicknessMaxR }}
            </td>
          </tr>
          <tr>
            <td colspan="2">形态（1=规则型，2=不规则型）</td>
            <td>
              {{ auditJson.plaqueShapeR }}
            </td>
            <td colspan="2">是否溃疡型（0=否，1=是）</td>
            <td>
              {{ auditJson.plaqueUlcerR }}
            </td>
          </tr>
          <tr>
            <td colspan="5">
              质地（A1=均质低回声，A2=均质等回声，A3=均质强回声，B=不均质）
            </td>
            <td>
              {{ auditJson.plaqueTextureR }}
            </td>
          </tr>
          <tr>
            <td colspan="2">管腔直径狭窄率%</td>
            <td>
              {{ auditJson.plaqueStenosisRateR }}
            </td>
            <td colspan="2">狭窄部位</td>
            <td>
              {{ auditJson.plaqueStenosisPositionR }}
            </td>
          </tr>
        </table>
        <table
          v-if="
            auditType == '颈动脉' &&
            auditObject.project &&
            auditObject.project.includes('脑卒中')
          "
          border="1"
          style="width: 70%; border-collapse: collapse"
        >
          <tbody>
            <tr>
              <td colspan="12">
                检查结果：{{
                  auditJson.resultException == "0"
                    ? "全部正常"
                    : auditJson.resultException == "1"
                    ? "任一部位有异常"
                    : ""
                }}
              </td>
            </tr>
            <tr>
              <td rowspan="3" width="80px">异常类型</td>
              <td rowspan="3">异常项目</td>
              <td colspan="10">责任病灶部位（注：本节中“口”填写相应数字）</td>
            </tr>
            <tr>
              <td colspan="5">左侧</td>
              <td colspan="5">右侧</td>
            </tr>
            <tr>
              <td>颈总</td>
              <td>窦部</td>
              <td>颈内</td>
              <td>锁骨下动脉SA</td>
              <td>椎动脉VA</td>
              <td>颈总</td>
              <td>窦部</td>
              <td>颈内</td>
              <td>锁骨下动脉SA</td>
              <td>椎动脉VA</td>
            </tr>
            <tr>
              <td>内膜IMT</td>
              <td>增厚(IMT≥1.0mm)(1=是, 0=否)</td>
              <td>
                {{ auditJson.intimaImtAacL }}
              </td>
              <td>\</td>
              <td>\</td>
              <td>\</td>
              <td>\</td>
              <td>
                {{ auditJson.intimaImtAacR }}
              </td>
              <td>\</td>
              <td>\</td>
              <td>\</td>
              <td>\</td>
            </tr>
            <tr>
              <td rowspan="4">斑块</td>
              <td>数量</td>
              <td colspan="10" style="padding-left: 10px">
                {{
                  auditJson.plaqueCount == "0"
                    ? "无"
                    : auditJson.plaqueCount == "1"
                    ? "单发"
                    : auditJson.plaqueCount == "2"
                    ? "多发"
                    : ""
                }}
              </td>
            </tr>
            <tr>
              <td>形态(1=不规则, 0=规则)</td>
              <td>
                {{ auditJson.plaqueFormAacL }}
              </td>
              <td>
                {{ auditJson.plaqueFormSinusL }}
              </td>
              <td>
                {{ auditJson.plaqueFormIcaL }}
              </td>
              <td>
                {{ auditJson.plaqueFormSaL }}
              </td>
              <td>
                {{ auditJson.plaqueFormVaL }}
              </td>
              <td>
                {{ auditJson.plaqueFormAacR }}
              </td>
              <td>
                {{ auditJson.plaqueFormSinusR }}
              </td>
              <td>
                {{ auditJson.plaqueFormIcaR }}
              </td>
              <td>
                {{ auditJson.plaqueFormSaR }}
              </td>
              <td>
                {{ auditJson.plaqueFormVaR }}
              </td>
            </tr>
            <tr>
              <td>溃疡(1=有, 0=无)</td>
              <td>
                {{ auditJson.plaqueUlcerAacL }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerSinusL }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerIcaL }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerSaL }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerVaL }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerAacR }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerSinusR }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerIcaR }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerSaR }}
              </td>
              <td>
                {{ auditJson.plaqueUlcerVaR }}
              </td>
            </tr>
            <tr>
              <td>回声(1=强回声，2=中等回声，3=低回声，4=混合回声)</td>
              <td>
                {{ auditJson.plaqueEchoAacL }}
              </td>
              <td>
                {{ auditJson.plaqueEchoSinusL }}
              </td>
              <td>
                {{ auditJson.plaqueEchoIcaL }}
              </td>
              <td>
                {{ auditJson.plaqueEchoSaL }}
              </td>
              <td>
                {{ auditJson.plaqueEchoVaL }}
              </td>
              <td>
                {{ auditJson.plaqueEchoAacR }}
              </td>
              <td>
                {{ auditJson.plaqueEchoSinusR }}
              </td>
              <td>
                {{ auditJson.plaqueEchoIcaR }}
              </td>
              <td>
                {{ auditJson.plaqueEchoSaR }}
              </td>
              <td>
                {{ auditJson.plaqueEchoVaR }}
              </td>
            </tr>
            <tr>
              <td>狭窄或闭塞</td>
              <td>狭窄率(0=无狭窄，1=1-49%，2=50-69%，3=70-99%，4=闭塞)</td>
              <td>
                {{ auditJson.stenosisRateAacL }}
              </td>
              <td>
                {{ auditJson.stenosisRateSinusL }}
              </td>
              <td>
                {{ auditJson.stenosisRateIcaL }}
              </td>
              <td>
                {{ auditJson.stenosisRateSaL }}
              </td>
              <td>
                {{ auditJson.stenosisRateVaL }}
              </td>
              <td>
                {{ auditJson.stenosisRateAacR }}
              </td>
              <td>
                {{ auditJson.stenosisRateSinusR }}
              </td>
              <td>
                {{ auditJson.stenosisRateIcaR }}
              </td>
              <td>
                {{ auditJson.stenosisRateSaR }}
              </td>
              <td>
                {{ auditJson.stenosisRateVaR }}
              </td>
            </tr>
          </tbody>
        </table>
        <table
          v-if="auditType == '心脏'"
          border="1"
          style="width: 70%; border-collapse: collapse"
        >
          <tbody>
            <tr style="height: 50px">
              <td colspan="9">2D及M型主要测量数据(mm)：</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2">主动脉瓣环径</td>
              <td>{{ auditObject.m1 }}</td>
              <td>升主动脉径</td>
              <td>{{ auditObject.m2 }}</td>
              <td>左房前后径</td>
              <td>{{ auditObject.m3 }}</td>
              <td></td>
              <td></td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2">室间隔厚度</td>
              <td>{{ auditObject.m4 }}</td>
              <td>左室舒张末径</td>
              <td>{{ auditObject.m5 }}</td>
              <td>左室后壁厚度</td>
              <td>{{ auditObject.m6 }}</td>
              <td>LVEF</td>
              <td>{{ auditObject.m7 }}</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2">右室前后径</td>
              <td>{{ auditObject.m8 }}</td>
              <td>TAPSE</td>
              <td>{{ auditObject.m9 }}</td>
              <td></td>
              <td></td>
              <td>Simpson法EF</td>
              <td style="width: 120px">{{ auditObject.m10 }}</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="9">瓣叶（空缺为正常）</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2"></td>
              <td>结构</td>
              <td>前向流速m/s</td>
              <td>压差mmHg</td>
              <td>返流程度</td>
              <td>返流流速m/s</td>
              <td colspan="2">压差mmHg</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2">二尖瓣</td>
              <td>{{ auditObject.p1 }}</td>
              <td>{{ auditObject.p2 }}</td>
              <td>{{ auditObject.p3 }}</td>
              <td>{{ auditObject.p4 }}</td>
              <td>{{ auditObject.p5 }}</td>
              <td colspan="2">{{ auditObject.p6 }}</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2">三尖瓣</td>
              <td>{{ auditObject.q1 }}</td>
              <td>{{ auditObject.q2 }}</td>
              <td>{{ auditObject.q3 }}</td>
              <td>{{ auditObject.q4 }}</td>
              <td>{{ auditObject.q5 }}</td>
              <td colspan="2">{{ auditObject.q6 }}</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2">主动脉瓣</td>
              <td>{{ auditObject.r1 }}</td>
              <td>{{ auditObject.r2 }}</td>
              <td>{{ auditObject.r3 }}</td>
              <td>{{ auditObject.r4 }}</td>
              <td>{{ auditObject.r5 }}</td>
              <td colspan="2">{{ auditObject.r6 }}</td>
            </tr>
            <tr style="height: 50px">
              <td colspan="2">肺动脉瓣</td>
              <td>{{ auditObject.s1 }}</td>
              <td>{{ auditObject.s2 }}</td>
              <td>{{ auditObject.s3 }}</td>
              <td>{{ auditObject.s4 }}</td>
              <td>{{ auditObject.s5 }}</td>
              <td colspan="2">{{ auditObject.s6 }}</td>
            </tr>
            <tr style="height: 50px">
              <td>超声阳性所见</td>
              <td colspan="8">
                <!-- 超声阳性所见 -->
              </td>
            </tr>
            <tr style="height: 50px">
              <td>超声印象</td>
              <td colspan="8">
                {{ auditObject.impression }}
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <el-form
        v-if="
          auditType == '颈动脉' &&
          auditObject.project &&
          auditObject.project.includes('心血管')
        "
      >
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          超声描述
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <el-form-item label="" >
          <!-- <span style="color: #000; font-size: 16px">
            {{ auditJson.description }}
          </span> -->
          <div
            v-for="(item, index) in auditJson.description.split(
              '；'
            )"
            :key="index"
            style="color: #000; font-size: 16px; width: 100%;"
          >
            {{ item }}
          </div>
        </el-form-item>
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          超声提示
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <el-form-item label="">
          <!-- <span style="color: #000; font-size: 16px">
            {{ auditJson.summary }}
          </span> -->
          <div
            v-for="(item, index) in auditJson.summary.split(
              '；'
            )"
            :key="index"
            style="color: #000; font-size: 16px; width: 100%;"
          >
            {{ item }}
          </div>
        </el-form-item>
      </el-form>
      <el-form
        v-if="
          auditType == '颈动脉' &&
          auditObject.project &&
          auditObject.project.includes('脑卒中')
        "
      >
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          超声描述
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <el-form-item label=""
          ><span style="color: #000; font-size: 16px">{{
            auditJson.description
          }}</span></el-form-item
        >
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          超声提示
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <el-form-item label=""
          ><span style="color: #000; font-size: 16px">{{
            auditJson.summary
          }}</span></el-form-item
        >
      </el-form>
      <el-form v-if="auditType == '心脏'">
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          超声描述
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <el-form-item label=""
          ><span style="color: #000; font-size: 16px">{{
            auditJson.findings
          }}</span></el-form-item
        >
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          超声描述
        </div>
        <div
          style="
            width: 100%;
            height: 1px;
            background-color: #666;
            margin: 5px 0;
          "
        ></div>
        <el-form-item label=""
          ><span style="color: #000; font-size: 16px">{{
            auditJson.prompt
          }}</span></el-form-item
        >
      </el-form>
      <div style="font-size: 20px; font-weight: 600">其他信息</div>
      <div
        style="width: 100%; height: 1px; background-color: #666; margin: 5px 0"
      ></div>
      <el-form
        inline
        v-if="
          auditType == '颈动脉' &&
          auditObject.project &&
          auditObject.project.includes('心血管')
        "
      >
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">报告时间：</span>
          </template>
          <span style="font-size: 16px">{{ auditObject.reportTime }}</span>
        </el-form-item>
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">检查医师：</span>
          </template>
          <span style="font-size: 16px">{{ auditObject.docname }}</span>
        </el-form-item>
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">报告医师：</span>
          </template>
          <span style="font-size: 16px">{{ $store.getters.rname }}</span>
        </el-form-item>
      </el-form>
      <el-form
        inline
        v-if="
          auditType == '颈动脉' &&
          auditObject.project &&
          auditObject.project.includes('脑卒中')
        "
      >
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">报告时间：</span>
          </template>
          <span style="font-size: 16px">{{ auditObject.reportTime }}</span>
        </el-form-item>
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">检查医师：</span>
          </template>
          <span style="font-size: 16px">{{ auditObject.docname }}</span>
        </el-form-item>
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">报告医师：</span>
          </template>
          <span style="font-size: 16px">{{ $store.getters.rname }}</span>
        </el-form-item>
        <!-- <el-form-item label="报告时间：">{{ auditObject.reportTime }}</el-form-item>
        <el-form-item label="检查医师：">{{ auditObject.docname }}</el-form-item>
        <el-form-item label="报告医师：">{{ $store.getters.rname }}</el-form-item> -->
      </el-form>
      <el-form inline v-if="auditType == '心脏'">
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">报告时间：</span>
          </template>
          <span style="font-size: 16px">{{ auditObject.reportTime }}</span>
        </el-form-item>
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">检查医师：</span>
          </template>
          <span style="font-size: 16px">{{ auditObject.docname }}</span>
        </el-form-item>
        <el-form-item>
          <template #label>
            <span style="color: #000; font-size: 16px">报告医师：</span>
          </template>
          <span style="font-size: 16px">{{ $store.getters.rname }}</span>
        </el-form-item>
        <!-- <el-form-item label="报告时间：">{{ auditObject.reportTime }}</el-form-item>
        <el-form-item label="检查医师：">{{ auditObject.docname }}</el-form-item>
        <el-form-item label="报告医师：">{{ $store.getters.rname }}</el-form-item> -->
      </el-form>
      <div
        style="width: 100%; height: 1px; background-color: #666; margin: 5px 0"
      ></div>
      <el-form>
        <div style="font-size: 20px; font-weight: bold; margin: 5px 0">
          审核意见
        </div>
        <el-form-item label="">
          <el-radio-group v-model="auditOpinion">
            <el-radio label="1">
              <span style="color: #000; font-size: 16px">通过并上报</span>
            </el-radio>
            <el-radio label="0">
              <span style="color: #000; font-size: 16px">不通过并退回</span>
            </el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item v-if="auditOpinion && auditOpinion == 0">
          <template #label>
            <span style="color: #000; font-size: 16px">退回原因：</span>
          </template>
          <el-input v-model="returnReason" placeholder="请输入退回原因" />
        </el-form-item>
      </el-form>
      <div class="box-submit">
        <el-button @click="cancle">取消</el-button>
        <el-button type="primary" @click="submit">保存</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import { getUltraSoundList, checkUltraStat } from "@/apis/reportReview";
import { getUltraCardioList } from "@/apis/reportList";
import { ElMessage } from "element-plus";
import format from "@/utils/format";

export default {
  data() {
    return {
      auditOpinion: "",
      returnReason: "",
      auditObject: {},
      auditJson: {},
      videoList: [],
      auditType: "",
      loading:false
    };
  },
  mounted() {
    this.auditType = this.$store.getters.audittype
      ? this.$store.getters.audittype
      : "";
    console.log(this.$store.getters.audittype, "audittype");
    this.getAuditInfo();
    window.addEventListener("beforeunload", this.handleBeforeUnload);
  },
  methods: {
    // 获取数据
    getAuditInfo() {
      this.auditObject = {};
      this.videoList = [];
      this.auditJson = {};
      this.loading = true
      if (this.auditType == "颈动脉") {
        getUltraSoundList({
          page: 1, // 当前页
          size: 10, // 每页size
          uname: this.$store.getters.name, // 登录用户
          insname: this.$store.getters.insname, //用户机构名
          keyword: this.$store.getters.tsn, // 关键字
          c_sn: this.$store.getters.csn,
          inspectionStime: "", // 检查开始时间
          inspectionEtime: "", // 检查结束时间
          uploadStime: "", //上传开始时间
          uploadEtime: "", //上传结束时间
          reportStime: "", //报告开始时间
          reportEtime: "", //报告结束时间
          projectName: "", //项目点名称
          auditorName: "", //审核机构名称
          auditorDoctor: "", //审核医师
          reportStatus: "", //报告状态
        })
          .then((res) => {
            if (res.code == 0) {
              if (res.data && res.data.length > 0) {
                this.auditObject = res.data[0];
                res.data[0].reportTime = format(
                  Number(res.data[0].reportTime) * 1000,
                  "YYYY-MM-DD"
                );
                if (res.data[0].videourl) {
                  this.videoList = JSON.parse(res.data[0].videourl);
                }
                if (res.data[0].json) {
                  this.auditJson = JSON.parse(res.data[0].json);
                }
                console.log(this.auditJson, "auditJson111");
              }
            }
           this.loading = false
          })
          .catch(() => {
           this.loading = false
          });
      } else {
        getUltraCardioList({
          page: 1, // 当前页
          size: 10, // 每页size
          uname: this.$store.getters.name, // 登录用户
          insname: this.$store.getters.insname, //用户机构名
          keyword: this.$store.getters.tsn, // 关键字
          c_sn: this.$store.getters.csn,
          inspectionStime: "", // 检查开始时间
          inspectionEtime: "", // 检查结束时间
          uploadStime: "", //上传开始时间
          uploadEtime: "", //上传结束时间
          reportStime: "", //报告开始时间
          reportEtime: "", //报告结束时间
          projectName: "", //项目点名称
          auditorName: "", //审核机构名称
          auditorDoctor: "", //审核医师
          reportStatus: "", //报告状态
        })
          .then((res) => {
            if (res.code == 0) {
              if (res.data && res.data.length > 0) {
                console.log(res.data[0]);
                this.auditObject = res.data[0];
                if (res.data[0].videourl) {
                  this.videoList = JSON.parse(res.data[0].videourl);
                }
                res.data[0].reportTime = format(res.data[0].reportTime * 1000);
                this.auditJson = res.data[0];
                // if (res.data[0].json) {
                //   this.auditJson = JSON.parse(res.data[0].json)
                // }

                console.log(this.auditJson, "auditJson222");
              }
            }
           this.loading = false
          })
          .catch(() => {
        this.loading = false
          });
      }
    },
    // 取消
    cancle() {
      this.handleBeforeUnload();
      this.$router.go(-1);
    },
    // 保存
    submit() {
      let action = "";
      let returnReason = "";
      if (this.auditOpinion == "1") {
        action = "reviewed";
        returnReason = "";
      } else if (this.auditOpinion == "0") {
        action = "sendback";
        returnReason = this.returnReason;
      }
      console.log(action, "action");
      if (!action) {
        ElMessage({
          message: "请选择审核意见",
          type: "warning",
        });
      } else {
        checkUltraStat({
          uname: this.$store.getters.name,
          Gsn: this.auditObject.t_sn,
          c_sn: this.auditObject.c_sn,
          action: action,
          item: this.auditType,
          review_info: returnReason,
          reportDocname: this.$store.getters.rname,
        }).then((res) => {
          if (res.code == 0) {
            ElMessage({
              message: "保存成功",
              type: "success",
            });
            this.$router.go(-1);
          } else {
            ElMessage({
              message: "保存失败",
              type: "error",
            });
          }
        });
      }
    },
    async handleBeforeUnload() {
      let returnReason = "";
      if (this.auditOpinion == "1") {
        returnReason = "";
      } else if (this.auditOpinion == "0") {
        returnReason = this.returnReason;
      }
      await checkUltraStat({
        uname: this.$store.getters.name,
        Gsn: this.auditObject.t_sn,
        action: "cancel",
        item: this.auditType,
        review_info: returnReason,
        reportDocname: this.$store.getters.rname,
      });
    },
  },
  beforeDestroy() {
    window.removeEventListener("beforeunload", this.handleBeforeUnload);
  },
  beforeRouteLeave(to, from, next) {
    this.handleBeforeUnload();
    next();
  },
};
</script>